# Copyright (C) 2011 Roger Xu.
# Author: Roger Xu <roger.xu.2007@gmail.com>
#
# pacparser is a library that provides methods to parse proxy auto-config
# (PAC) files. Please read README file included with this package for more
# information about this library.

"""
Python module to parse pac files. Look at project's homepage
http://code.google.com/p/pacparser for more information.
"""

#==== Short sample ============================================================
import pacparser
pac = 'E:/workspace/rogerxu-hg/rules/android.pac'

print pacparser.just_find_proxy(pac, "https://twitter.com")

#==== Longer sample ============================================================
import pacparser
pac = 'E:/workspace/rogerxu-hg/rules/android.pac'

pacparser.init()
pacparser.parse_pac(pac)
proxy = pacparser.find_proxy("https://twitter.com")
print proxy
pacparser.cleanup()

